package cn.com.flever;

import cn.com.flever.utils.CopyFile;
import cn.com.flever.utils.ReadResolution;

import java.io.File;

/**
 * @author fengjian
 * @date 2020/6/21 12:19
 */
public class Main {

    public static void main(String[] args) throws Exception {
        String imgPath="C:\\Users\\#{userName}\\AppData\\Local\\Packages\\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\\LocalState\\Assets";
        String copyPath="C:\\tmp\\";
        File cpPath=new File(copyPath);
        if(!cpPath.exists())
        {
            cpPath.mkdir();
        }
        imgPath=imgPath.replace("#{userName}",System.getProperty("user.name"));
        File floder=new File(imgPath);
        String[] list = floder.list();
        for (String s : list) {
            String newPath=imgPath+"\\"+s+".png";
            String sourcePath=imgPath+"\\"+s;
            File sourceFile=new File(sourcePath);
            File copyFile=new File(copyPath+"\\"+s+".png");
            CopyFile.copyFile(sourceFile,copyFile);
            String[] hw=ReadResolution.getResolution1(copyFile).split(",");
            if(hw[0].compareTo(hw[1])<=1)
            {
                copyFile.delete();
            }
        }
    }


}
